#ifndef ROOMDIALOG_H
#define ROOMDIALOG_H

#include <QDialog>
#include <QSqlRelationalTableModel>
#include <QTextCodec>
#include <QMessageBox>
#include <QKeyEvent>

#include "../../Headers/Classes/room.h"
#include "../../Headers/DataAccessors/roomdataaccessor.h"

namespace Ui {
    class RoomDialog;
}

class RoomDialog : public QDialog
{
    Q_OBJECT

public:
    explicit RoomDialog(QWidget *parent = 0);
    ~RoomDialog();

    void Update();
    bool checkSelected();

    Room * getCurrentRoom();

private slots:
    void on_closeButton_clicked();

    void on_createButton_clicked();

    void on_editButton_clicked();

    void on_deleteButton_clicked();

    void on_tableView_doubleClicked(const QModelIndex &index);

    void keyPressEvent(QKeyEvent *event);

private:
    Ui::RoomDialog *ui;
};

#endif // ROOMDIALOG_H
